import request from '@/config/axios'

export interface ProjectTaskVO {
  orderProduceInfoId: number
  dictTaskStatus: number
  dictTaskType: number
  projectContractFileName: string
  projectContractFileUrl: string
  orderNumber: string
  dictOrderType: number
  customerName: string
  productCode: string
  modelSpecification: string
  unit: string
  orderQuantity: number
  orderDate: Date
  deliveryDate: Date
  dictDeliveryProjectType: number
  dictChangeType: number
  orderVersion: string
  quotation: number
  taxIncludedPrice: number
  priceTaxTotal: number
  taxRate: number
  remarks: string
  productName: string
}

// 查询项目任务单列表
export const getProjectTaskPage = async (params) => {
  return await request.get({ url: `/order/project-task/page`, params })
}

// 查询项目任务单详情
export const getProjectTask = async (id: number) => {
  return await request.get({ url: `/order/project-task/get?id=` + id })
}

// 新增项目任务单
export const createProjectTask = async (data: ProjectTaskVO) => {
  return await request.post({ url: `/order/project-task/create`, data })
}

// 修改项目任务单
export const updateProjectTask = async (data: ProjectTaskVO) => {
  return await request.put({ url: `/order/project-task/update`, data })
}

// 更新项目任务单项目合同文件
export const updateProjectupdateFile = async (data) => {
  return await request.put({ url: `/order/project-task/updateFile`, data })
}

// 删除项目任务单
export const deleteProjectTask = async (id: number) => {
  return await request.delete({ url: `/order/project-task/delete?id=` + id })
}

// 导出项目任务单 Excel
export const exportProjectTask = async (params) => {
  return await request.download({ url: `/order/project-task/export-excel`, params })
}

// 导出项目任务单 Excel
export const submitOaAuditProjectTask = async (data) => {
  return await request.post({ url: `/order/project-task/submitOaAudit`, data })
}
